
import React, { useState, useEffect } from 'react'
import { reqMiaoSha } from '../../../../request/api'
import juan1 from "../../../../assets/img/home_youhuijuan1.png"
export default function MiaoSha() {
    let [arr, setArr] = useState([])
    useEffect(() => {
        reqMiaoSha().then(res => {
            setArr(res.list)
            console.log(res.list);
        })
    }, [])
    return (
        <div className="xianshi">
            <p className="p1">
                <img src={juan1} alt="" />
                <span>信任特价商品专区</span>
                <i>(信任供应，先到先得)</i>
            </p>
            <ul>
                {
                    arr.map(item => {
                        return (
                            <li key={item.id}>
                                <img src={item.img} alt="" />
                                <div className="d1">
                                    <p>{item.price}</p>
                                    <del>{item.market_price}</del>
                                </div>
                                <div className="d2">
                                    <span className="iconfont">&#xe612;</span>
                                </div>
                            </li>
                        )
                    })
                }
            </ul>
        </div>


    )
}
